///
/// 评论信息
///
class QMMessage {
  /// 消息id
  String? id;

  /// 消息内容
  String? text;

  /// 消息类型
  String? messageType;

  /// 会话id
  String? sessionId;

  /// 访客id
  String? userId;

  /// 接入会话的渠道id
  String? accessId;

  /// 消息创建时间
  String? createdTime;

  /// 消息来源
  /// 访客/坐席 @“1”
  String? fromType;

  /// 消息发送状态
  /// 0-成功 1-发送失败 2-发送中
  String? status;

  /// 语音消息时长
  String? recordSeconds;

  /// 本地文件缓存相对路径
  String? localFilePath;

  /// 文件网络地址
  String? remoteFilePath;

  /// 文件名称
  String? fileName;

  /// 文件大小
  String? fileSize;

  /// mpd文件大小
  String? mp3FileSize;

  /// 文件下载状态
  String? downloadState;

  /// 客服工号
  String? agentExten;

  /// 客服名称
  String? agentName;

  /// 客服头像
  String? agentIcon;

  /// 消息是否来源于机器人
  /// 1-机器人
  /// 2-非机器人
  String? isRobot;

  /// 消息类型
  /// system-系统消息
  /// robot-机器人消息
  /// UUID-人工消息
  /// my-我自己发送的消息
  String? userType;

  /// 消息是否展示以及副标题消息权限(目前用于语音转文本)
  /// 0-不展示
  /// 1-展示
  String? messageStatus;

  /// 消息是否已读
  /// 1-已读
  /// 0-未读
  String? idRead;

  /// 语音消息已读未读
  /// 1-已读
  /// 0-未读
  String? voiceRead;

  /// 满意度评价id
  String? evaluateId;

  /// 满意度评价是否已评价
  /// 同一个满意度id下的 是否已评价
  String? evaluateStatus;

  /// 平台信息 iOS Android
  String? platform;

  /// 设备型号
  String? device;

  QMMessage(
      {this.id,
      this.text,
      this.messageType,
      this.sessionId,
      this.userId,
      this.accessId,
      this.createdTime,
      this.fromType,
      this.status,
      this.recordSeconds,
      this.localFilePath,
      this.remoteFilePath,
      this.fileName,
      this.fileSize,
      this.mp3FileSize,
      this.downloadState,
      this.agentExten,
      this.agentName,
      this.agentIcon,
      this.isRobot,
      this.userType,
      this.messageStatus,
      this.idRead,
      this.evaluateId,
      this.evaluateStatus,
      this.platform,
      this.device});

  QMMessage.fromMap(Map<dynamic, dynamic>? map) {
    id = map?['id'];
    text = map?['text'];
    messageType = map?['messageType'];
    sessionId = map?['sessionId'];
    userId = map?['userId'];
    accessId = map?['accessId'];
    createdTime = map?['createdTime'];
    fromType = map?['fromType'];
    status = map?['status'];
    recordSeconds = map?['recordSeconds'];
    localFilePath = map?['localFilePath'];
    remoteFilePath = map?['remoteFilePath'];
    fileName = map?['fileName'];
    fileSize = map?['fileSize'];
    mp3FileSize = map?['mp3FileSize'];
    downloadState = map?['downloadState'];
    agentExten = map?['agentExten'];
    agentName = map?['agentName'];
    agentIcon = map?['agentIcon'];
    isRobot = map?['isRobot'];
    userType = map?['userType'];
    messageStatus = map?['messageStatus'];
    idRead = map?['idRead'];
    evaluateId = map?['evaluateId'];
    evaluateStatus = map?['evaluateStatus'];
    platform = map?['platform'];
    device = map?['device'];
  }

  Map<dynamic, dynamic> toMap() {
    Map map = Map();
    map['_id'] = id;
    map['message'] = text;
    map['messageType'] = messageType;
    map['sessionId'] = sessionId;
    map['userId'] = userId;
    map['accessId'] = accessId;
    map['createdTime'] = createdTime;
    map['fromType'] = fromType;
    map['status'] = status;
    map['recordSeconds'] = recordSeconds;
    map['localFilePath'] = localFilePath;
    map['remoteFilePath'] = remoteFilePath;
    map['fileName'] = fileName;
    map['fileSize'] = fileSize;
    map['mp3FileSize'] = mp3FileSize;
    map['downloadState'] = downloadState;
    map['agentExten'] = agentExten;
    map['agentName'] = agentName;
    map['agentIcon'] = agentIcon;
    map['isRobot'] = isRobot;
    map['userType'] = userType;
    map['messageStatus'] = messageStatus;
    map['idRead'] = idRead;
    map['evaluateId'] = evaluateId;
    map['evaluateStatus'] = evaluateStatus;
    map['platform'] = platform;
    map['device'] = device;
    return map;
  }
}
